﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    xmlns:pieces="clr-namespace:UI.Pieces"
    xmlns:UI="clr-namespace:UI"
    x:Class="UI.View3D"
    Height="auto" Width="auto" Loaded="UserControl_Loaded">
    <Grid x:Name="LayoutRoot" Height="auto" Width="auto">
        <Viewport3D ClipToBounds="True" x:Name="_3DChess" d:LayoutOverrides="VerticalAlignment" Margin="0,-8,0,8">
            <Viewport3D.Camera>
                <PerspectiveCamera x:Name="Camera" FieldOfView="45" FarPlaneDistance="100" LookDirection="0,25.066,-19.976" Position="0,-25.066,19.976" NearPlaneDistance="0.1" UpDirection="0.003,0.623,0.782"/>
            </Viewport3D.Camera>
            <ModelVisual3D x:Name="AmbientLightContainer5" >
                <ModelVisual3D.Content>
                    <AmbientLight x:Name="AmbientLight5" Color="#FF393939">
                        <AmbientLight.Transform>
                            <Transform3DGroup>
                                <TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
                                <ScaleTransform3D ScaleX="1" ScaleY="1" ScaleZ="1"/>
                                <RotateTransform3D d:EulerAngles="257.168,-5.909,271.343">
                                    <RotateTransform3D.Rotation>
                                        <AxisAngleRotation3D Angle="130.661" Axis="-0.639,0.575,-0.511"/>
                                    </RotateTransform3D.Rotation>
                                </RotateTransform3D>
                                <TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
                                <TranslateTransform3D OffsetX="8.171" OffsetY="0.318" OffsetZ="11.812"/>
                            </Transform3DGroup>
                        </AmbientLight.Transform>
                    </AmbientLight>
                </ModelVisual3D.Content>
                <ModelVisual3D.Transform>
                    <Transform3DGroup>
                        <TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
                        <ScaleTransform3D ScaleX="1" ScaleY="1" ScaleZ="1"/>
                        <RotateTransform3D d:EulerAngles="0,0,0"/>
                        <TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
                        <TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
                    </Transform3DGroup>
                </ModelVisual3D.Transform>
            </ModelVisual3D>
            <ModelVisual3D x:Name="DirectionalLightContainer5" >
                <ModelVisual3D.Transform>
                    <Transform3DGroup>
                        <TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
                        <ScaleTransform3D ScaleX="1" ScaleY="1" ScaleZ="1"/>
                        <RotateTransform3D d:EulerAngles="0,0,0"/>
                        <TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
                        <TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
                    </Transform3DGroup>
                </ModelVisual3D.Transform>
                <ModelVisual3D.Content>
                    <DirectionalLight x:Name="DirectionalLight5" Color="#FFCCCCCC">
                        <DirectionalLight.Transform>
                            <Transform3DGroup>
                                <TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
                                <ScaleTransform3D ScaleX="1" ScaleY="1" ScaleZ="1"/>
                                <RotateTransform3D d:EulerAngles="0,0,0"/>
                                <TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
                                <TranslateTransform3D OffsetX="-1.471" OffsetY="0.856" OffsetZ="12.239"/>
                            </Transform3DGroup>
                        </DirectionalLight.Transform>
                    </DirectionalLight>
                </ModelVisual3D.Content>
            </ModelVisual3D>
            <UI:ChessBoard x:Name="BoardB" SquaresColor="Chocolate"/>
            <UI:ChessBoard x:Name="BoardW" SquaresColor="WhiteSmoke">
                <ModelVisual3D.Transform>
                    <RotateTransform3D>
                        <RotateTransform3D.Rotation>
                            <AxisAngleRotation3D Angle="90" Axis="0,0,1"/>
                        </RotateTransform3D.Rotation>
                    </RotateTransform3D>
                </ModelVisual3D.Transform>
            </UI:ChessBoard>
            <!--Set the chessboard initial pieces and their positions-->
            <pieces:Pawn x:Name="WPawn1" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="WPawn2" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="WPawn3" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="WPawn4" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="WPawn5" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="WPawn6" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="WPawn7" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="WPawn8" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="BPawn1" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="BPawn2" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="BPawn3" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="BPawn4" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="BPawn5" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="BPawn6" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="BPawn7" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Pawn x:Name="BPawn8" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Pawn>
            <pieces:Bishop x:Name="WBishop1" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Bishop>
            <pieces:Bishop x:Name="WBishop2" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Bishop>
            <pieces:Bishop x:Name="BBishop1" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Bishop>
            <pieces:Bishop x:Name="BBishop2" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Bishop>
            <pieces:Knight x:Name="WKnight1" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Knight>
            <pieces:Knight x:Name="WKnight2" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Knight>
            <pieces:Knight x:Name="BKnight1" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Knight>
            <pieces:Knight x:Name="BKnight2" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Knight>
            <pieces:Rook x:Name="WRook1" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Rook>
            <pieces:Rook x:Name="WRook2" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Rook>
            <pieces:Rook x:Name="BRook1" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Rook>
            <pieces:Rook x:Name="BRook2" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Rook>
            <pieces:King x:Name="WKing" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:King>
            <pieces:King x:Name="BKing" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:King>
            <pieces:Queen x:Name="WQueen" Side="White" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Queen>
            <pieces:Queen x:Name="BQueen" Side="Black" OnCoordinatesChanged="OnPieceCoordChange"></pieces:Queen>
        </Viewport3D>
    </Grid>
</UserControl>
